package com.neusoft.SPNursingHome.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.neusoft.SPNursingHome.po.Admin;
import com.neusoft.SPNursingHome.po.Food;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface AdminDao extends BaseMapper<Admin> {
    /** 新方法：只按账号查用户，密码留给 Service 去比对 */
    @Select("SELECT * FROM admin WHERE ad_account = #{account}")
    Admin findByAccount(@Param("account") String account);

    @Select("SELECT * FROM admin WHERE ad_account = #{account} AND ad_password = #{password}")
    Admin login(@Param("account") String account, @Param("password") String password);
}
